package edu.unf.cen6940.web;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>ThesistoolController</code> controller.
 *
 * @see edu.unf.cen6940.web.ThesistoolController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/rms_test-security-context.xml",
		"file:./resources/rms_test-service-context.xml",
		"file:./resources/rms_test-dao-context.xml",
		"file:./resources/rms_test-web-context.xml" })
public class ThesistoolControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>editThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>listThesistoolThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetlistThesistoolThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/listThesistoolThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>indexThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetindexThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/indexThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>editThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteThesistool()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteThesistool() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteThesistool");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>thesistoolControllerbinaryaction()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetthesistoolControllerbinaryaction() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/thesistoolController/binary.action");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		ThesistoolController controller = (ThesistoolController) context.getBean("ThesistoolController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}